package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CoursePreviewDto;
import com.xuecheng.content.service.CoursePublishService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiao
 * @Date 2024/12/11 20:22
 * @ClassName: MediaOpenController
 * @Description: 媒资文件管理接口
 */
@Api(tags = "课程公开查询接口")
@RestController
@RequestMapping("/open")
@RequiredArgsConstructor
public class CourseOpenController {

    private final CoursePublishService coursePublishService;

    /**
     * @param courseId
     * @return
     * @Desc:  获取课程预览信息
     */
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto getPreviewInfo(@PathVariable Long courseId){
        return coursePublishService.getCoursePreviewInfo(courseId);
    }



}
